package com.ttxs.generator.output.other;

import com.ttxs.generator.engine.CustomFreemarker;
import com.ttxs.generator.output.Output;
import com.ttxs.generator.vo.FormBean;

import java.io.File;
import java.io.IOException;

public class ParentPomXml implements Output {
    @Override
    public void write(CustomFreemarker templateEngine) throws IOException {
        FormBean formBean = templateEngine.formBean();
        if (formBean.isSpringCloud()) {
            File pomXml = new File(FormBean.ROOT_PATH
                    + File.separator + formBean.getPlatformName()
                    + File.separator + "pom.xml");
            templateEngine.outputFile(pomXml, templateEngine.customMap(), "templates/pom.parent.xml.ftl");
        }
    }
}
